import { RouteItem } from '@/types/route';

const Layout = () => import('@/layout/index.vue');

// 公共路由,配置详情请参见RouteItem定义
export const constantRoutes: RouteItem[] = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/auth/login.vue'),
    hidden: true,
    meta: { title: '登录页' }
  },
  {
    path: '/register',
    component: () => import('@/views/auth/register.vue'),
    hidden: true,
    meta: { title: '注册页' }
  },
  {
    path: '',
    component: Layout,
    redirect: '/index',
    children: [
      {
        path: '/index',
        component: () => import('@/views/index.vue'),
        name: 'Index',
        meta: { title: '首页', icon: 'dashboard', affix: true }
      }
    ]
  },
  {
    path: '/user',
    component: Layout,
    hidden: true,
    redirect: 'noredirect',
    children: [
      {
        path: 'profile',
        component: () => import('@/views/system/user/profile/index.vue'),
        name: 'Profile',
        meta: { title: '个人中心', icon: 'user' }
      }
    ]
  },
  {
    path: '/tool/design-print',
    children: [
      {
        path: 'index',
        component: () => import('@/views/tool/designPrint/index.vue'),
        name: 'DesignPrintEdit',
        meta: { title: '打印模板管理' }
      }
    ]
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/error/404.vue'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/error/401.vue'),
    hidden: true
  }
];